package filter.service.impl;

import filter.pojo.Person;
import filter.service.Criteria;

import java.util.ArrayList;
import java.util.List;

public class CriteriaMaleImpl implements Criteria {
    @Override
    public List<Person> filter(List<Person> list) {
        ArrayList<Person> people = new ArrayList<>();
        for (Person item: list){
            if (item.getSex().equals("male")){
                people.add(item);
            }
        }
        return people;
    }
}
